<?php include TMPL_PATH.'public/header.phtml';?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>单页列表</em></a><span>|</span>
        <a href='<?php echo U('article/page_add');?>' ><em>添加单页</em></a>
    </div>
</div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th width="38">排序</th>
            <th width="50">ID</th>
            <th align='left'>单页名称</th>
            <th align='center' width="150">发布时间</th>
						<th>管理操作</th>
            </tr>
        </thead>
    <tbody>
    <?php 
   	if(isset($pageList) && $pageList):
   		foreach ($pageList as $v):
   ?>
			<tr>
					<td align='center'><input id="listorder-<?php echo $v['id']?>" name='listorders[<?php echo $v['id']?>]' type='text' size='3' title="当光标离开输入框后修改排序" value='<?php echo $v['listorder']?>' onblur="javascript:setting_listorder(<?php echo $v['id']?>);" class='input-text-c'></td>
					<td align='center'><?php echo $v['id']?></td>
					<td><?php echo $v['name']?></td>
					<td align='center'><?php echo date('Y-m-d H：i:s', $v['start_time']);?></td>
					<td align='center'> 
					<a href="<?php echo U('article/page_edit', 'pid='.$v['id']);?>">修改</a> | 
					<a href="javascript:confirmurl('<?php echo U('article/page_delete', 'pid='.$v['id']);?>','确认要删除 『<?php echo $v['title']?>』 吗？')">删除</a>
					</td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
function setting_listorder(id){
	var lisobj = $('#listorder-'+id);
	listorder = parseInt(lisobj.val());
	if(isNaN(listorder)){
		alert('排序只能设置为整数.');return;
	}
	$.get('<?php echo U('article/change_page_listorder_ajax');?>',{pid:id,listorder:listorder},function(data){
		if(data==1){lisobj.val(listorder)}
	});
}
//-->
</script>